package com.xsmart.oa.services.wx;

import com.xsmart.common.constant.ResultConstant;
import com.xsmart.common.entity.RequestBean;
import com.xsmart.common.entity.ResponseBean;
import com.xsmart.oa.dao.wx.UserApplyManagerDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class UserApplyManagerService {

    @Autowired
    UserApplyManagerDao userApplyManagerDao;

    public ResponseBean addUserTask(RequestBean requestBean) {

        Integer userId = requestBean.getRequestParamInteger("userId");
        String userName = requestBean.getRequestParamString("userName");
        Integer taskType = requestBean.getRequestParamInteger("taskType");
        String phone = requestBean.getRequestParamString("phone");
        String sellerName = requestBean.getRequestParamString("sellerName");

        Map<String, Object> magMap = new HashMap<>();
        magMap.put("userId",userId);
        magMap.put("taskType",taskType);
        magMap.put("userName",userName);
        magMap.put("phone",phone);
        magMap.put("sellerName",sellerName);

        userApplyManagerDao.addUserTask(magMap);
        ResponseBean responseBean = requestBean.getResponseBean();
        responseBean.setResult(ResultConstant.SUCCESS);
        return responseBean;
    }
}
